home *** CD-ROM | disk | FTP | other *** search
/ Acorn User: China / Acorn User China CD-ROM (UK) (Disc A) / Acorn User China CD-ROM (UK) (Disc A).bin / HENSA / VIRUS / VKILL.ARC / !VKiller_Docs_ArchieDoc < prev    next >
Encoding:
Text File  |  1991-05-06  |  5.0 KB  |  100 lines

  1. This is very detailed (although stopping short of a disassembly of course)
  2. description of ArchieVirus. It is strongly recommended reading, if only to
  3. give you a better understanding of how the virus operates.
  4.  
  5. ArchieVirus technical information
  6. ---------------------------------
  7.  
  8. This is a piece of ARM code that is appended to executables with the Absolute
  9. (&FF8) filetype. It is 920 (&398) bytes long and has a tell-tale 4-character
  10. string at the end of its code, "1210", which is used as an "already-infected"
  11. flag. The first instruction of the original executable is saved near the end
  12. of the virus code space and is replaced by a branch to the first instruction
  13. of the ArchieVirus code.
  14.  
  15. Here's a complete run-down of what ArchieVirus does when first run:
  16.  
  17. 1. Attempts to infect executables (Absolute filetype) with the filespecs "@.*"
  18.    and "%.*". In other words, all executables in the current and library
  19.    directory are attacked.
  20.  
  21. 2. Uses OS_File 36 as a "semaphore" to see if it is lodged in RMA. If a call
  22.    to OS_File 36 returns with an error, then it hasn't infected the RMA yet,
  23.    so it proceeds to claim 920 bytes of RMA, copy itself into there and
  24.    points a claim of the OS_File vector to its new RMA location.
  25.    NOTE: A *RMTidy command effectively releases this OS_File claim and is
  26.          an easy manual way of removing ArchieVirus from the RMA.
  27.  
  28. 3. The time is checked to see if it is the 13th of the month. If so, the
  29.    code loops indefinitely, displaying the 45-character message:
  30.    
  31.    Hehe...ArchieVirus strikes again...
  32.  
  33.    Since there is no linefeed present, this will fill the screen with a fast
  34.    scrolling blur :-) Obviously, Shift-Ctrl will allow mere humans to read it.
  35.    Interestingly, this is the only place that the virus name, ArchieVirus,
  36.    is found and this is tricky to spot because it is EORed with &64.
  37.  
  38. 4. Assuming it wasn't the 13th of the month (and NO, it doesn't check for a
  39.    Friday !), then the original first instruction of the executable is replaced
  40.    and the original normal code continues from &8000 onwards.
  41.  
  42. The OS_File vector claim is quite important, because this serves two purposes:
  43.  
  44. a. It allows OS_File 36 to return without an error, signalling that the RMA
  45.    is already infected.
  46.  
  47. b. It checks for OS_Files 0 and 10 (Save memory to file), 11 (create empty
  48.    file) and 12,14,16 and 255 (Load file). If any of these are encountered
  49.    then an infection attack is activated (see step 1 above).
  50.  
  51. ArchieVirus Decrement Count
  52. ---------------------------
  53.  
  54. Yet again, this is a virus that has a strange way of keeping track of infect-
  55. ions. A count is DECREMENTED after a successful infection, which is strange
  56. indeed. It's as if the author was considering a "limiter" in the code (when
  57. count = 0, don't infect anymore), but decided not to include one at the last
  58. minute. Of course, it could just be a warped mind - only the author knows the
  59. original value of the count, so a simple subtraction will give ONLY HIM the
  60. number of infections. By the way, the copy of ArchieVirus I have has its
  61. decrement count at 1 in case you're interested. VKiller will displayed this
  62. Decrement Count when the ArchieVirus is detected.
  63.  
  64. Possibly serious problems with ArchieVirus
  65. ------------------------------------------
  66.  
  67. The version of ArchieVirus I was given has a constant &A718 at offset &20
  68. from the start of the ArchieVirus code. This constant is *supposed* to
  69. indicate the start address of the ArchieVirus code + 12. However, this
  70. constant NEVER changes and the code incorrectly uses it for a copy reference
  71. point when duplicating itself into RMA. Hence, any calls to OS_File once this
  72. faulty ArchieVirus code is installed will cause an "Address exception" or
  73. "Undefined instruction" error depending on what rubbish has been copied into
  74. the RMA.
  75.  
  76. Ironically, I have patched one instruction in my own personal copy of Archie-
  77. Virus to use a relative address and the code is now stable and no longer
  78. crashes :-) I have done this because I suspect the original author of Archie-
  79. Virus may have spotted the bug and patched the code in a similar way to me.
  80.  
  81. As is very typical with many viruses, the ArchieVirus code does very little
  82. file error checking and frequently reports "Not open for update" if the file
  83. is locked or the disk is write-protected whilst attempting an infection.
  84.  
  85. ArchieVirus Innoculation
  86. ------------------------
  87.  
  88. The 4 character ASCII string "1210" at the end of the executable is checked
  89. for existence by ArchieVirus to decide if it has infected the executable yet.
  90.  
  91. It is therefore easy to innoculate against ArchieVirus in two steps:
  92. 1) Replace the first instruction of the original executable with the copy
  93.    held in the virus code area and
  94. 2) Remove the 920 bytes of virus code and replace it with the 8 character
  95.    string "Hypo1210" (this was the string originally used by Hugo Fiennes'
  96.    "Hypothermic" innoculator so I've decided to stick with his convention).
  97.  
  98. Hence, the executable will shrink back in size to only 8 bytes longer than
  99. its original length and will have been innoculated too.
  100.